# koroFileHeader at Yungoal acer
# Create: 2022-06-28 09:44:12
# LastEdit: 2022-06-28 09:58:30
"""说明暂无"""
__author__ = '749B'


def underline_to_camelcase(name: str, first_upper: bool = False):
    """下划线转驼峰式"""
    if '_' not in name:
        return name
    if first_upper:
        return(''.join([ i.capitalize() for i in name.split('_') ]))
    return(''.join([ v.capitalize() if i else v for i, v in enumerate(name.split('_')) ]))
    


if __name__ == '__main__':
    print(underline_to_camelcase('underline_to_camelcase'))
    print(underline_to_camelcase('underline_to_camelcase', True))
    print(underline_to_camelcase('tenant_id'))